﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using 深入浅出WPF_BookDemo.Views;

namespace 深入浅出WPF_BookDemo.UserController
{
    /// <summary>
    /// WeatherListItemView.xaml 的交互逻辑
    /// </summary>
    public partial class WeatherListItemView : UserControl
    {
        public WeatherListItemView()
        {
            InitializeComponent();
        }

        private Weather weather;

        public Weather Weather
        {
            get { return weather; }
            set
            {
                weather = value;
                this.textCity.Text = weather.City;
                string uriStr = string.Format(@"/Icons/{0}.png", weather.Status);
                this.imageLogo.Source = new BitmapImage(new Uri(uriStr, UriKind.Relative));
            }

        }

    }

}
